﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace comm
{
    public static class Safety
    {
        public static string SHA1Encode(byte[] bytes)
        {
            var sha1 = new SHA1Managed();
            var b = sha1.ComputeHash(bytes);
            return BitConverter.ToString(b).Replace("-", "");
        }
        public static string SHA1Encode(string str)
        {
            return SHA1Encode(str);
        }
    }
}
